<h1>Message Queue Status</h1>
<?php
    $this->headScript()->appendFile('/js/BizSense/Crud.js');
    $acl = $this->acl;
?>
<?php if ($acl->isAllowed($this->currentUser, 'access newsletter pages')): ?>
<a href="<?php echo $this->url(array(
        'module'    =>'newsletter',
        'controller'=>'index',
        'action'    =>'index'
        ), null, true); ?>">Newsletter</a>
<?php endif; ?>  |

<?php if  ($acl->isAllowed($this->currentUser, 'access newsletter pages')): ?>
<a href="<?php echo $this->url(array(
    'module'    =>'newsletter', 
    'controller'=>'settings',
    'action'    =>'index'
    )
  , null, true); ?>">Settings</a>
  |
<?php endif; ?>


<?php if ($acl->isAllowed($this->currentUser, 'access newsletter pages')): ?>
<a href="<?php echo $this->url(array(
        'module' => 'newsletter',
        'controller' => 'message',
        'action' => 'index'
        ), null, true); ?>">Message</a> | 
<?php endif; ?>

<?php 
if ($acl->isAllowed($this->currentUser, 'access newsletter pages')): 
    $deleteUrl = $this->url(array(
                    'module' => 'newsletter',
                    'controller' => 'queue',
                    'action' => 'cancelall'
                )
            );
    echo $this->confirmButton($deleteUrl,"Cancel");
endif; 
?>

<div class="clearing"> </div>

<?php
    $this->headTitle('Messages Queue Status');
    echo $this->message;
    $totalMessages = $this->totalMessages;
    $totalMessagesWithHtmlFormat = $this->totalMessagesWithHtmlFormat;
    $totalMessagesWithTextFormat = $this->totalMessagesWithTextFormat;
    $totalUniqueDomains = $this->totalUniqueDomains;
?>
<table class="data_table">
    <tr>
        <th>Description</th>
        <th>Number</th>
    </tr>
    <tr>
        <td><?php echo "Total messages to be sent"; ?></td>
        <td><?php echo $this->escape($totalMessages); ?> </td> 
    </tr>
    <tr>
        <td><?php echo "Total recipients with HTML format"; ?></td>
        <td><?php echo $this->escape($totalMessagesWithHtmlFormat); ?> </td> 
    </tr>
    <tr>
        <td><?php echo "Total recipients with TEXT format"; ?></td>
        <td><?php echo $this->escape($totalMessagesWithTextFormat); ?> </td> 
    </tr>
    <tr>
        <td><?php echo "Total unique domains"; ?></td>
        <td><?php echo $this->escape($totalUniqueDomains); ?> </td> 
    </tr>
</table>
<p>
    The stastics do not include messages delivered.
</p>

